• Changing the Size and Style of the Document Window- ODFDraw -ODFBitmap
• Changing the Size and Style of the Part Window
Floating Windows
ODFDraw: In CDrawPart::Initialize the palette presentations are registered and then the three FW_CFloatingWindow objects are created (CDrawPart::InitializePalettes). Note that the platform window and frame will only be created when the window is shown for the first time. In CDrawPart::DoMenu the requested palette is shown by calling FW_CFloatingWindow::ShowHide. Showing the palette will trigger the creation of the frame (CDrawPart::NewFrame). Notice also here that because floating windows are shared among parts with the same editor in the same document your NewFrame method could be called multiple times to create a frame you have in fact already created. You need to keep track of that by keeping a pointer to your frame and returning it instead of creating a brand new one. Finally when your part goes away delete your floating window objects (CDrawPart::ReleaseAll).
Zoom
Your root frame's AdjustZoomedWindowSize method will be called when the user clicks on the window zoom box. The size of the main screen is used to calculate the suggested size (this is the inside size of the window). If your part does not want to zoom full screen it can change the suggested size by overriding AdjustZoomedWindowSize.
ODFBitmap: look at CBitmapFrame::AdjustZoomedWindowSize. The suggested size is set to the size of the bitmap plus a 10 pixel border.
Minimum and Maximum Size
Your root frame's AdjustWindowGrowLimits method will be called when the user resizes one of your windows. AdjustWindowGrowLimits has two parameters: minSize and maxSize. When calling AdjustWindowGrowLimits ODF passes a suggested minimumsize of (64, 64) and a suggested maximum size of (32000, 32000).
ODFDraw: look at CDrawFrame::AdjustWindowGrowLimits. The maximum size is left untouched but the minimum size is changed to (72, 72) plus the size of the ruler (if present) and the size of the scrollbars.
Changing the Size and Style of the Document Window
When your part editor is the root of the document, ODF calls the method FW_CPart::NewDocumentWindow to create the document window. The default implementation creates a standard document the size of the main screen. If you want to change the default size and style you need to override NewDocumentWindow.
ODFDraw: look at CDrawPart::NewDocumentWindow. The window size is calculated using the size of the document. The window position is determined using the screen bounds top left corner.
ODFBitmap: look at CBitmapPart::NewDocumentWindow. The window size is calculated using the bitmap bounds. The window position is calculated the same way as ODFDraw by using the top left corner of the screen bounds.
Changing the Size and Style of the Part Window
A part window is a window created as a result of a command like: “View In Window”. Your frame's NewPartWindow method is called to create the FW_CWindow object. To change the position, size, or style of this window override FW_CFrame::NewPartWindow. None of the ODF samples currently overrides NewPartWindow.